package com.usian.order.controller;


import cn.hutool.json.JSONObject;
import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.internal.util.AlipaySignature;
import com.alipay.api.request.AlipayTradePagePayRequest;
import com.alipay.api.response.AlipayTradePagePayResponse;
import com.usian.common.Result;
import com.usian.common.ResultCodeEnum;
import com.usian.entity.Orders;
import com.usian.entity.Payment;
import com.usian.entity.PaymentRecords;
import com.usian.order.alipay.AliPayProperties;
import com.usian.order.service.IOrdersService;
import com.usian.order.service.IPaymentRecordsService;
import com.usian.order.service.OrderItemService;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.apache.poi.hpsf.Date;
import org.apache.poi.hpsf.Decimal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;
import java.util.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author author
 * @since 2025-01-15
 */
@RestController
@RequestMapping("/order/payment-records")
public class PaymentRecordsController {

    @Autowired
    private IPaymentRecordsService paymentRecordsService;

    @Operation(summary = "根据订单id查询支付记录")
    @GetMapping("/getPaymentRecordsByOrderId/{orderId}")
    public Result<PaymentRecords> getPaymentRecordsByOrderId(@PathVariable Integer orderId){
        return paymentRecordsService.getPaymentRecordsByOrderId(orderId);
    }
}
